package org.example.netty.test.nio.bean;

import org.example.netty.test.bio.NioDemoConfig;

import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;

/**
 * @author zp
 * @version 1.0
 * @description: TODO
 * @date 2023/2/21 19:13
 */
public class Client {
    //文件名称
    public String fileName;
    //长度
    public long fileLength;
    //开始传输的时间
    public long startTime;
    //客户端的地址
    public InetSocketAddress remoteAddress;
    //输出的文件通道
    public FileChannel outChannel;
    //接收长度
    public long receiveLength;

    public ByteBuffer buffer = ByteBuffer.allocate(NioDemoConfig.SEND_BUFFER_SIZE);

    public boolean isFinished() {
        return receiveLength >= fileLength;
    }

}
